/**
 * 存储配置
 */

const { isProd } = require('../utils/env')

const { MYSQLNAME, MYSQLPATH, PATH, MYSQLPSD } =  require('./constant');

let WX_CONFIG = {
    wxchatAppId: 'wx0bfa497974c56f01',
    wxchatSecret: '33dea635a8df42695fb9619cc9e68228'
}
let MYSQL_CONF = {
    host: MYSQLPATH,
    user: 'root',
    password: MYSQLPSD,
    timezone: '+08:00',
    dialectOptions: {
        dateStrings: true,
        typeCast: true
    },
    port: '3306',
    database: MYSQLNAME
}

if (isProd) { //生产环境
    // REDIS_CONF = {
    //     // 线上的 redis 配置
    //     port: 9268,
    //     host: PATH
    // }

    MYSQL_CONF = {
        // 线上的 mysql 配置
        host: MYSQLPATH,
        user: 'root',
        timezone: '+08:00',
        dialectOptions:{
            dateStrings:true,
            typeCast:true
        },
        password: MYSQLPSD,
        port: '3306',
        database: MYSQLNAME
    }

}

module.exports = {
    // REDIS_CONF,
    WX_CONFIG,
    MYSQL_CONF
}
